package com.ctn.information.content;

import java.util.ArrayList;

import com.ctn.information.R;
import com.ctn.information.view.XListViewFragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.RelativeLayout;

/**
 * 中心区域面板 - 微博
 * 
 * @author HLJ
 *
 */
public class WeiboFragment extends XListViewFragment {
	
	private ArrayAdapter<String> mAdapter;
	private ArrayList<String> items = new ArrayList<String>();
	private int start = 0;
	private static int refreshCnt = 0;
	
	public WeiboFragment(){
		super();
		openSlidingMenuTouch = true;
	}
	
	@Override
	public ListAdapter geneListAdapter() {
		for (int i = 0; i != 20; ++i) {
			items.add("refresh cnt " + (++start));
		}
		mAdapter = new ArrayAdapter<String>(getActivity(), R.layout.list_item, items);
		return mAdapter;
	}

	@Override
	public ListAdapter refresh(ListAdapter listAdapter) {
		start = ++refreshCnt;
		items.clear();
		return geneListAdapter();
	}

	@Override
	public ListAdapter load(ListAdapter listAdapter) {
		return geneListAdapter();
	}
	
	
}
